// 我的辅导
<template>
  <div class="app-container">
    <el-table v-loading="loading" :data="scaleList" :border="true">
      <el-table-column label="序号" type="index" align="center">
        <template slot-scope="scope">
          <span>{{ scope.$index + 1 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="方案名称" align="center" key="name" prop="name" />

      <el-table-column
        label="测评时段"
        align="center"
        prop="createTime"
        :show-overflow-tooltip="true"
        width="300"
      >
        <template slot-scope="scope">
          <span>{{ scope.row.startDate }}</span>
          <span>—</span>
          <span>{{ scope.row.endDate }}</span>
        </template>
      </el-table-column>

      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
        width="230"
      >
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="reportClik(scope.row)"
            v-hasPermi="['system:user:edit']"
            >学习</el-button
          >
          <el-button
            size="mini"
            type="text"
            icon="el-icon-share"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:user:edit']"
            >查看</el-button
          >
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 查看对话框 -->
    <ViewSolution  ref="Solution"/>

    <!-- 学习对话框 -->
    <el-dialog
      :visible.sync="study"
      width="1200px"
      append-to-body
      :close-on-click-modal="false"
    >
      <div class="learnTiter" style="margin-top: -20px">课程信息</div>
      <div class="details">辅导计划</div>
      <div class="learnTiter">课程信息</div>
      <div class="comment">
        <el-input
          v-model="remark"
          type="textarea"
          placeholder="请输入内容"
        ></el-input>
      </div>

      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFileForm">确 定</el-button>
        <el-button @click="study = false">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  formSetting, //测评详情
} from "@/api/itemBank/index";
import ViewSolution from "../../components/ViewSolution/index.vue"
export default {
  name: "User",
  dicts: [
    "sys_normal_disable",
    "sys_user_sex",
    "suitable_object",
    "measure_status",
  ],
  components: {ViewSolution},
  data() {
    return {
      // 遮罩层
      loading: true,
      //禁止输入
      displays: false,
      // 总条数
      total: 0,
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      study: false,
      // 日期范围
      dateRange: [],
      // 搜素日期范围
      dateRange1: [],
      // 量表选项
      scaleList: [],
      //   试题列表
      testList: [],
      // 表单参数
      form: { classIds: [], schoolIds: null, studentIds: [] },
      remark: "",
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
    };
  },
  watch: {},
  created() {
    this.getList();
  },
  methods: {
    /** 查询测评列表 */
    getList() {
         this.loading = false;
         return
      this.loading = true;
      this.queryParams.measureType = "2";
      formSetting(this.queryParams).then((response) => {
        this.scaleList = response.rows;
        this.scaleList.forEach((ve) => {
          ve.serial = 0;
        });
        this.total = response.total;
        this.loading = false;
      });
    },

    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.dateRange = [];

      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      (this.queryParams.startDate = this.dateRange1[0]),
        (this.queryParams.endDate = this.dateRange1[1]),
        (this.queryParams.pageNum = 1);
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      // this.dateRange = [];
      this.dateRange1 = [];
      this.resetForm("queryForm");
      this.handleQuery();
    },

    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      // this.open = true;
      console.log("触发了",this.$refs.Solution)
    this.$refs.Solution.open=true;
    },

    /** 提交按钮 */
    submitForm: function () {},

    //上传模型
    reportClik() {
      //   this.upload.title = "测评报告";
      this.study = true;
    },

    // 提交上传文件
    submitFileForm() {
      this.study = false;
    },
  },
};
</script>
<style scoped lang="scss">
.learnTiter {
  width: 100%;
  padding: 5px;
  color: #569cd6;
}
.details {
  height: 540px;
  margin: 0 10px;
  overflow-x: hidden;
  overflow-y: scroll;
}
.rabbet {
  // width: 500px;
  height: 60px;
  display: flex;
}
.scheme {
  margin: 0 15px;
  background-color: #ecf5ff;
  border-radius: 5px;
  height: 30px;
  padding: 0 5px;
  line-height: 30px;
  border: 1px solid #569cd6;
}
.tickling{
  display: flex;
 div:nth-child(1){
    color: #000;
    height: 30px;
    padding: 0 5px;
  }
  div:nth-child(2){
    width: 360px;
    margin-left: 10px;
    color: #000;
    height: 60px;
    padding: 3px 10px;
    border:2px solid #ecf5ff;
    border-radius: 6px;
  }
}
</style>
